package com.flying.scorer.score.equity.marketdata;

import com.flying.refdata.model.equity.EquityInfo;
import com.flying.refdata.model.equity.MarketData;
import com.flying.refdata.service.MarketDataService;
import com.flying.scorer.score.ScoreException;

public class MA30EquityScorer extends AbstractMarketDataScorer {
    public MA30EquityScorer(MarketDataService service) {
        super(service);
    }

    @Override
    public double score(int date, EquityInfo info) throws ScoreException {
        MarketData md = getMarketData(info, date);
        double price = md.getClosingPrice();
        if (price < md.getMa30()) return 0;
        else return 6;
    }
}